package models

import "time"

type SysScore struct {
	ID int `json:"id" gorm:"primary key;not null;AUTO_INCREMENT"`
	StuID int `json:"stu_id" gorm:"index;not null"`
	Name string `json:"name"`
	CourseID int `json:"course_id" gorm:"index;not null"`
	Score float64 `json:"score" gorm:"not null"`
	SemesterID int `json:"semester_id" gorm:"index;not null"`
	ClassID int `json:"class_id"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
	Student SysStudent `gorm:"ForeignKey:StuID;AssociationForeignKey:StuID" json:"student"`
	Course SysCourse `gorm:"ForeignKey:CourseID;AssociationForeignKey:ID" json:"course"`
	Semester SysSemester `gorm:"ForeignKey:SemesterID;AssociationForeignKey:ID" json:"semester"`
	Class SysClass `gorm:"ForeignKey:ClassID;AssociationForeignKey:ID" json:"class"`
}